<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To throws a popup image for the end machine # Configuration Type - COMPUTER # Dependency File - Upload the image file and update the file name accordingly in the script. #> # Set the source file path $sourceFile = "Wallpaper.jpg" # Change the upload file name here # Set the destination directory $destinationFolder = "C:\Program Files (x86)\ManageEngine\UEMS_Agent\images" # Copy the file to the destination, forcefully overwriting if it exists Copy-Item -Path $sourceFile -Destination $destinationFolder -Force Write-Host "File has been copied successfully, forcefully overwriting if needed." # Load System.Windows.Forms namespace Add-Type -AssemblyName System.Windows.Forms # Create a new form $form = New-Object System.Windows.Forms.Form $form.Text = "Image Popup" $form.Width = 640 $form.Height = 480 # Create a new PictureBox control $pictureBox = New-Object System.Windows.Forms.PictureBox $pictureBox.Width = 600 $pictureBox.Height = 400 $pictureBox.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::StretchImage $pictureBox.Image = [System.Drawing.Image]::FromFile("C:\Program Files (x86)\ManageEngine\UEMS_Agent\images\Wallpaper.jpg") # Change the upload file name here # Add PictureBox to form $form.Controls.Add($pictureBox) # Create a timer to close the form after 5 minutes $timer = New-Object System.Windows.Forms.Timer $timer.Interval = 2 * 60 * 1000 # 2 minutes in milliseconds $timer.Add_Tick({ $timer.Stop() # Stop the timer $form.Close() # Close the form }) $timer.Start() # Start the timer # Show the form $form.ShowDialog()